<!DOCTYPE html>
<html>
<head>
	<title>Shopping Cart</title>
	<style >
	td{
		text-align: center;
	}
	</style>
</head>
<body>

<h1>Shopping Cart</h1>
	<form action="<?php echo $frontend; ?>update_cart" method="post"

		<table>	
		<thead>
			<tr>
				<th>Product name</th>
				<th>Quantity</th>
				<th>Price</th>
			</tr>
		</thead>
		<tbody>	

			<?php foreach ($contents as $key => $content) { ?>
			<tr>
				<td><?php echo $content['name'] ;?></td>
				<td><input type="text" name="qty[]" valure="<?php echo $content['qty'];?> " </td>
				<td><?php echo $content['price'] ;?></td>
			</tr>	
		<input type="hidden" name="rowid[]" value="<?php echo $content['rowid'] ;?>">	
		<input type="hidden" name="prodid[]" value="<?php echo $content['id'] ;?>">	
		<?php }
				?>
				<tr>
					<td>Total</td>
					<td><?php echo $this->cart->total() ;?></td>
				</tr>
		</tbody>
		</table>
		<input type="submit" name="submit" value="Update">
		</form>
	<form action="<?php echo $frontend; ?>buy" method='post'>			<label>*First name</label>
	<input type="text" name="first_name" value="<?php echo set_value('first_name');?>">
	<label>*Last name</label>
	<input type="text" name="last_name" value="<?php echo set_value('last_name');?>">
	<label>*Email id</label>
	<input type="text" name="email_id" value="<?php echo set_value('email_id');?>">
	<label>*Phone number</label>
	<input type="text" name="phone_no" value="<?php echo set_value('phone_no');?>">
	<label>*Address Line 1</label>
	<input type="text" name="address-line1" value="<?php echo set_value('address_line1');?>">
	<label>*Address Line 2</label>
	<input type="text" name="address-line2" value="<?php echo set_value('address_line2');?>">
	<label>*City</label>
	<input type="text" name="city" value="<?php echo set_value('city');?>">
	<label>*State</label>
	<input type="text" name="state" value="<?php echo set_value('state');?>">
	<label>*Pincode</label>
	<input type="text" name="pincode" value="<?php echo set_value('pincode');?>">
	<label>Companny name</label>
	<input type="text" name="company_name" value="<?php echo set_value('company_name');?>">

		<input type="submit" name="submit" value="Buy now">
	

</body>
</html>